<?php
$params = array_merge(require (__DIR__ . '/../../common/config/params.php'), require (__DIR__ . '/params.php'));
define('TIME', time());
$config = [
    'id' => 'app-apiadmin',
    'defaultRoute'=>'v1/',
    'basePath' => dirname(__DIR__),
    'modules' => [ // 添加模块v1和v2，分别表示不同的版本
        'v1' => [
            'class' => 'apiadmin\modules\v1\module'
        ],
    
    ],
    'controllerNamespace' => 'apiadmin\controllers',
    'components' => [
        'log' => [
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'exportInterval' => 1,
                ],
            ],
        ],
        'request' => [
            'cookieValidationKey' => 'w3BnewAWmCrjijzkiLucYD5Ty1Ym_V9F'
        ],
        'urlManager' => [
            'enablePrettyUrl' => true, // 美化url==ture
            'rules' => [
            ]
        ],
    ],
    'params' => $params
];

if (YII_ENV_DEV) {
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = [
        'class' => 'yii\debug\Module',
    ];
    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
        'generators' => [
            'model' => [
                'class' => 'yii\gii\generators\model\Generator',
                'templates' => [
                    'admin' => '../../common/giiTemplate/model',
                ]
            ],
            'crud' => [
                'class' => 'yii\gii\generators\crud\Generator',
                'templates' => [
                    'adminlte' => '../../common/giiTemplate/controller',
                ]
            ],
        ]
    ];
}

return $config;